/* Gannet OS - Kernel IO Fucntions
 
 This file is the serial functions for the kernel to write and read from IO
 ports (e.g. controllers). It should only really be used by the kernel and its
 'drivers'.

 This is the code file (see io.h for the header)

 This is part of the Gannet OS, For copy right and licensing see LICENSE in the
 root folder, or visit http://gannet.org.uk/license/
*/

#include "io.h"

inline void outb( unsigned short port, unsigned char val )
{
    asm volatile( "outb %0, %1"
                  : : "a"(val), "Nd"(port) );
}

inline unsigned char inb( unsigned short port )
{
    unsigned char ret;
    asm volatile( "inb %1, %0"
                  : "=a"(ret) : "Nd"(port) );
    return ret;
}